# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Dataproc.V1.Model.ExecutorStageSummary do
  @moduledoc """
  Executor resources consumed by a stage.

  ## Attributes

  *   `diskBytesSpilled` (*type:* `String.t`, *default:* `nil`) - 
  *   `executorId` (*type:* `String.t`, *default:* `nil`) - 
  *   `failedTasks` (*type:* `integer()`, *default:* `nil`) - 
  *   `inputBytes` (*type:* `String.t`, *default:* `nil`) - 
  *   `inputRecords` (*type:* `String.t`, *default:* `nil`) - 
  *   `isExcludedForStage` (*type:* `boolean()`, *default:* `nil`) - 
  *   `killedTasks` (*type:* `integer()`, *default:* `nil`) - 
  *   `memoryBytesSpilled` (*type:* `String.t`, *default:* `nil`) - 
  *   `outputBytes` (*type:* `String.t`, *default:* `nil`) - 
  *   `outputRecords` (*type:* `String.t`, *default:* `nil`) - 
  *   `peakMemoryMetrics` (*type:* `GoogleApi.Dataproc.V1.Model.ExecutorMetrics.t`, *default:* `nil`) - 
  *   `shuffleRead` (*type:* `String.t`, *default:* `nil`) - 
  *   `shuffleReadRecords` (*type:* `String.t`, *default:* `nil`) - 
  *   `shuffleWrite` (*type:* `String.t`, *default:* `nil`) - 
  *   `shuffleWriteRecords` (*type:* `String.t`, *default:* `nil`) - 
  *   `stageAttemptId` (*type:* `integer()`, *default:* `nil`) - 
  *   `stageId` (*type:* `String.t`, *default:* `nil`) - 
  *   `succeededTasks` (*type:* `integer()`, *default:* `nil`) - 
  *   `taskTimeMillis` (*type:* `String.t`, *default:* `nil`) - 
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :diskBytesSpilled => String.t() | nil,
          :executorId => String.t() | nil,
          :failedTasks => integer() | nil,
          :inputBytes => String.t() | nil,
          :inputRecords => String.t() | nil,
          :isExcludedForStage => boolean() | nil,
          :killedTasks => integer() | nil,
          :memoryBytesSpilled => String.t() | nil,
          :outputBytes => String.t() | nil,
          :outputRecords => String.t() | nil,
          :peakMemoryMetrics => GoogleApi.Dataproc.V1.Model.ExecutorMetrics.t() | nil,
          :shuffleRead => String.t() | nil,
          :shuffleReadRecords => String.t() | nil,
          :shuffleWrite => String.t() | nil,
          :shuffleWriteRecords => String.t() | nil,
          :stageAttemptId => integer() | nil,
          :stageId => String.t() | nil,
          :succeededTasks => integer() | nil,
          :taskTimeMillis => String.t() | nil
        }

  field(:diskBytesSpilled)
  field(:executorId)
  field(:failedTasks)
  field(:inputBytes)
  field(:inputRecords)
  field(:isExcludedForStage)
  field(:killedTasks)
  field(:memoryBytesSpilled)
  field(:outputBytes)
  field(:outputRecords)
  field(:peakMemoryMetrics, as: GoogleApi.Dataproc.V1.Model.ExecutorMetrics)
  field(:shuffleRead)
  field(:shuffleReadRecords)
  field(:shuffleWrite)
  field(:shuffleWriteRecords)
  field(:stageAttemptId)
  field(:stageId)
  field(:succeededTasks)
  field(:taskTimeMillis)
end

defimpl Poison.Decoder, for: GoogleApi.Dataproc.V1.Model.ExecutorStageSummary do
  def decode(value, options) do
    GoogleApi.Dataproc.V1.Model.ExecutorStageSummary.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Dataproc.V1.Model.ExecutorStageSummary do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
